package com.eddy.service.impl;

import com.eddy.entity.User;
import com.eddy.mapper.UserMapper;
import com.eddy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAllUser(String username, int pageStart, int pageSize) {
        return userMapper.getAllUser(username,pageStart,pageSize);
    }

    @Override
    public int getUserTotal(String username) {
        return userMapper.getUserTotal(username);
    }

    @Override
    public int updateState(Integer id, Integer state) {
        return userMapper.updateState(id,state);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public User getUser(Integer id) {
        return userMapper.getUser(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }
}
